package javaCode.chapter06.本章作业;

//给定一个Java程序的代码如下所示，则编译运行后，输出结果是
public class Homework07 { //公有类
    int count = 9;  //属性

    public void count1() { //Homework07的成员方法
        count = 10;
        System.out.println("count1= " + count);
    }

    public void count2() {
        System.out.println("count1= " + count++);
    }

    //这是Homework07的main方法，任何一个类，都可以有main
    public static void main(String[] args) {
        //1. new Homework07() 是匿名对象，匿名对象使用后，就不能使用
        //2. new Homework07().count1() 创建好匿名对象后，就调用count1()
        new Homework07().count1();

        Homework07 test = new Homework07();
        test.count2();
        test.count2();
        System.out.println(test.count);
    }
}
